package pteam;

import simulator.Actor;
import simulator.Robot;
import simulator.Sensor;

public class BlockActor implements Actor{
	public final int TOOCLOSEC = 15; //when to turn right
	public final int TOOCLOSEL = 50; //what is defined as hugging wall to left
	public boolean tooCloseC; 
	public boolean tooCloseL;
	
	
	

	@Override
	public void act(Robot s) {
		try { Thread.sleep(40); } catch(Exception e) {} //SLOW DOWN
		
		
		
	}

	@Override
	public void updateSensors(Sensor[] s) {
		//left rangefinder sensor
	    if (s[4].getState()[0] < TOOCLOSEL) {
	      tooCloseL = true;
	    } else { tooCloseL = false;}
	    
	    // center rangefinder sensor
	    if (s[1].getState()[0] < TOOCLOSEC) {
		      tooCloseC = true;
		    } else { tooCloseC = false;}
	}

	@Override
	public String getMaze() {
		return "block";
	}

}
